package subumbo.demo.controller {
	import org.robotlegs.mvcs.Command;
	
	import subumbo.demo.model.CopyModel;
	import subumbo.demo.service.CopyService;
	import subumbo.demo.view.ViewPool;
	import subumbo.demo.view.wishform.WishForm;

	public class LanguageChangeCommand extends Command {
		
		[Inject] public var copyModel:CopyModel;
		[Inject] public var copyService:CopyService;
		[Inject] public var viewPool:ViewPool;
		
		public override function execute():void {
			
			commandMap.detain(this);
			
			copyService.language = copyModel.language;
			copyService.send();
			
			
			contextView.removeChild(viewPool.selector);
			viewPool.wishForm = new WishForm();
			contextView.addChild(viewPool.wishForm);
			
		}
		
	}
}